import java.awt.event.MouseEvent;
import java.io.IOException;
import java.util.concurrent.ExecutionException;
import clojure.lang.RT;
import clojure.lang.Var;

@SuppressWarnings("serial")
public class TwitterButtonGetTweetsController extends TwitterButtonController {

	public TwitterButtonGetTweetsController(String defaultImagePath,
			String rolloverImagePath) {
		super(defaultImagePath, rolloverImagePath);
		
		try {
			RT.loadResourceScript("UpdateTweets.clj");
		} catch (IOException e1) {
			e1.printStackTrace();
		}
		Var report = RT.var("clj.script.examples", "mouseClicked");
		report.invoke(this);
	}
/*	
	@Override
	public void mouseClicked(MouseEvent e) {
		Thread thread = new Thread() {
			@Override
			public void run() {
				try {
					TweetPanelModel.updateTweets();
				} catch (InterruptedException | ExecutionException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		};
		thread.start();
		
	}
*/
	public static void updateTweets() {
		try {
			TweetPanelModel.updateTweets();
		} catch (InterruptedException | ExecutionException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
